package src.epat.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import src.epat.model.EnvModel;
import src.epat.model.TaskModel;
import src.epat.service.EnvService;
import src.epat.service.TaskService;

import java.util.List;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/env")
public class EnvController {


    @Autowired
    EnvService envService;

    @RequestMapping(value = "/add")
    public void add(String name) {
        envService.addEnv(name);
    }



    @RequestMapping(value = "/del")
    public void del(Long id) {
        envService.del(id);
    }

    @RequestMapping(value = "/list")
    public List<EnvModel> list() {
       return envService.list();
    }


}
